import wx

"""Hello,wxPython! program"""

import os
current_path = os.getcwd()
print(current_path)

class MyFrame(wx.Frame):
    """Frame class that displays an image"""

    def __init__(self, image, parent=None, id=-1,
                 pos=wx.DefaultPosition, title="Hello,wxPython"):
        temp = image.ConvertToBitmap()
        size = temp.GetWidth() + 10, temp.GetHeight() + 20
        super().__init__(parent, id, title, pos, size)
        self.bmp = wx.StaticBitmap(parent=self, bitmap=temp)  # 将静态位图控件添加到Fram中



class MyApp(wx.App):

    # APP启动是 OnInit将被调用
    def OnInit(self):
        image = wx.Image('../resouce/wxPython.jpg', wx.BITMAP_TYPE_JPEG)
        self.frame = MyFrame(image)
        self.frame.Show()
        self.SetTopWindow(self.frame)
        return True


def main():
    app = MyApp()
    app.MainLoop()


if __name__ == '__main__':
    main()
